package com.haredot.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.haredot.dto.ResourceSolrDTO;
import com.haredot.entity.Comments;
import com.haredot.entity.Resource;
import com.haredot.entity.ResourceType;
import com.haredot.vo.R;
import com.haredot.vo.ResourceDetailVo;
import com.haredot.vo.ResourceVo;
import org.springframework.data.solr.core.query.result.HighlightPage;

import java.util.Map;

/**
* @author Administrator
* @description 针对表【tb_resource】的数据库操作Service
* @createDate 2023-09-02 22:00:46
*/
public interface ResourceService extends IService<Resource> {

    R<ResourceType> queryResourceTypeLists();

    R<?> saveResource(Resource resource);

    R<ResourceDetailVo> queryDetailsData(Long resId);

    R<Page<? extends Comments>> resourceComments(Page<? extends Comments> page, Long resId);


    HighlightPage<ResourceSolrDTO> fullSearchResource(Integer current, Integer rows, String word);

    R<Map<String, Object>> queryResourcesByPage(Page<Page<Map<String, Object>>> page, Long typeId);

    R<?> collectResource(Long resId);

    R<Map<String, Object>> queryMoreResourceByUid(Page<Page<ResourceVo>> page, Long uid);

    R<Map<String, Integer>> checkDownLoadPermission(Long resId);
}
